package com.hrt.datasender.web.bcdrive;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;

import com.btcode.web.core.annotation.RequestMapping;
import com.btcode.web.core.controller.Controller;
import com.hrt.common.web.DSRequestUnit;
import com.hrt.datasender.datacollect.drive.DriveParameterMetadata;
import com.hrt.datasender.datacollect.model.DriveModel;
import com.hrt.datasender.datadao.service.BcDriverService;

/**
 * 驱动
 * 
 * @author gislin
 *
 */
@RequestMapping(path = "BCDrive")
public class BCDriveController extends Controller {

    @RequestMapping(path = "getList")
    public void getModel(ServletRequest arg0, ServletResponse arg1) throws IOException {

        List<DriveModel> devices = BcDriverService.getInstance().getExistDrives();

        success(devices);
    }

    @RequestMapping(path = "getParameterMetadata")
    public void getParameterMetadata(ServletRequest arg0, ServletResponse arg1) throws IOException {

        String driveId = DSRequestUnit.getString("driveId");
        List<DriveParameterMetadata> params = BcDriverService.getInstance().getParameterMetadata(driveId);
        success(params);
    }
}
